package dao

import (
	"fitness/internal/entity/system"
	"go.uber.org/zap"
	"gorm.io/gorm"
)

type SysDictItemDao struct {
	DB  *gorm.DB
	Log *zap.Logger
}

func NewSysDictItemDao(DB *gorm.DB, Log *zap.Logger) *SysDictItemDao {
	return &SysDictItemDao{
		DB:  DB,
		Log: Log,
	}
}

func (sysDictItemDao *SysDictItemDao) List(dictId uint) []system.SysDictItem {
	var dictItems []system.SysDictItem
	sysDictItemDao.DB.Where("dict_id = ?", dictId).Find(&dictItems)
	return dictItems
}
